package com.ebs.md.fxmonitor.marketmonitor.model;

/**
 * Perforce Revision:
 *  $File: //depot/MarketData/fxmonitor/main/src/main/java/com/ebs/md/fxmonitor/marketmonitor/model/PassiveHitSingleFactBTS.java $
 *  $Revision: #6 $  $Change: 116049 $  $DateTime: 2012/10/22 10:56:23 $  $Author: Arik.Sher $
 */

import com.ebs.md.api.BookSide;
import com.ebs.md.api.Rate;
import com.ebs.md.api.hit.IHitSubmit;
import com.ebs.md.api.product.PairProduct;

/**
 * 
 * BTS - Between The Spread
 */
public class PassiveHitSingleFactBTS
extends AbsSingleFactByTrader
{
	// gened with Eclipse
	private static final long serialVersionUID = 2476845275833362957L;

	protected Rate bestBid;
	protected Rate bestOffer;
	
	public PassiveHitSingleFactBTS(String configInstanceName, PairProduct pair, long timestamp, String quoteId, Rate quoteRate, BookSide bookSide
			, String floorCode, String traderId
			, Rate bestBid, Rate bestOffer
	) {
		super(configInstanceName, pair, timestamp, quoteId, quoteRate, bookSide
			, floorCode, traderId);
		this.bestBid   = bestBid;
		this.bestOffer = bestOffer;
	}

	public PassiveHitSingleFactBTS(String configInstanceName, IHitSubmit hitSubmit, TOBState tobState)
	{
		super( configInstanceName
			 , tobState.getPair()
			 , hitSubmit.getTime().getTimeInMillis()
			 , hitSubmit.getId()
			 , hitSubmit.getRate()
			 , hitSubmit.getHitSide().getMatchBookSide()
			 , hitSubmit.getDealCode()
			 , hitSubmit.getTraderId()
			 );
		this.availAmount = hitSubmit.getAmount();
		this.totalAmount = hitSubmit.getAmount();

		this.quoteRegion = hitSubmit.getRegion();

		this.bestBid   = tobState.getBestBid();
		this.bestOffer = tobState.getBestOffer();
	}

	public Rate getBestBid() {
		return bestBid;
	}

	public Rate getBestOffer() {
		return bestOffer;
	}

	protected String additionalFields4toString() {
		return 
		       super.additionalFields4toString()
			+ ", hitId=" + quoteId
			+ ", bestBid=" + bestBid
			+ ", bestOffer=" + bestOffer
			;
	}

}
